package de.slothsoft.wasbinich.swingclient.database;

import de.slothsoft.wasbinich.core.database.ApplicationBean;
import de.slothsoft.wasbinich.core.database.Database;
import de.slothsoft.wasbinich.core.database.LoginBean;
import de.slothsoft.wasbinich.core.database.ManagerBean;
import de.slothsoft.wasbinich.core.database.PictureBean;
import de.slothsoft.wasbinich.core.database.webservice.RestCommunicator;
import de.slothsoft.wasbinich.core.database.webservice.WebservicePictureBean;

public class SwingWebserviceDatabase extends Database {

    private final JerseyRestCommunicator restCommunicator = new JerseyRestCommunicator(false);

    @Override
    protected PictureBean createPictureBean() {
	return new WebservicePictureBean(getRestCommunicator());
    }

    @Override
    protected ApplicationBean createApplicationBean() {
	return new SwingWebserviceApplicationBean(getRestCommunicator());
    }

    @Override
    protected ManagerBean createManagerBean() {
	return new SwingWebserviceManagerBean(getRestCommunicator());
    }

    @Override
    protected LoginBean createLoginBean() {
	return new SwingLoginBean(new JerseyRestCommunicator(true));
    }

    protected RestCommunicator getRestCommunicator() {
	return this.restCommunicator;
    }
}
